<%--
  Created by IntelliJ IDEA.
  User: YYY-Work
  Date: 2017/5/4
  Time: 18:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path;
%>
<!DOCTYPE>
<html>
<head>
    <title>Title</title>
    <meta charset="UTF-8">
    <title>AdminLTE | Data Tables</title>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>


    <!-- start分页需要使用以下三个js -->
    <script type="text/javascript" src="<%=basePath%>/js/jquery-2.1.1.min.js"></script>
    <script type="text/javascript" src="<%=basePath%>/js/admin/utils.js"></script>
    <script type="text/javascript" src="<%=basePath%>/js/base/listtable.js"></script>
    <!-- end分页需要使用以上三个js -->
    <style>
        .table th, .table td {
            text-align: center;
            vertical-align: middle!important;
        }
    </style>
</head>
<body class="skin-blue">

<!-- getHeader -->
<s:action name="getHeader" namespace="/privilege" executeResult="true"/>
<div class="wrapper row-offcanvas row-offcanvas-left">
    <!-- getMenus -->
    <s:action name="getMenus" namespace="/privilege" executeResult="true"/>
    <!-- Right side column. Contains the navbar and content of the page -->
    <aside class="right-side">

        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                <small>基础档案-热门咨询</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
                <li><a href="#">Tables</a></li>
                <li class="active">Data tables</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <div class="col-xs-12">
                    <div class="box">
                        <div class="box box-danger">
                            <div class="box-body">
                                <form action="javascript:searchAdvertisement();" class="form-horizontal" name="searchForm">

                                    <div class="form-group" >
                                        <lable class="control-label" style="float: left;margin-left: 30px">名称</lable>
                                        <div class="col-sm-2">
                                            <input type="text" id="condition1" class="input-small form-control" >
                                        </div>
                                        <lable class="control-label" style="float: left">展示位置</lable>
                                        <div class="col-sm-2">
                                            <select class="form-control" id="position">
                                                <option value="">全部</option>
                                                <option value="1">用户头部广告</option>
                                                <option value="2">用户热门资讯</option>
                                                <option value="3">医生通知</option>
                                            </select>
                                        </div>
                                        <lable class="control-label" style="float: left">状态</lable>
                                        <div class="col-sm-1">
                                            <select class="form-control" id="state">
                                                <option value="">全部</option>
                                                <option value="1">启用</option>
                                                <option value="-1">停用</option>
                                            </select>
                                        </div>
                                        <button type="submit" class="btn">查询</button>

                                        <a href="${basePath}/common/requestAddAdvertisement.action">
                                            <button type="button" class="btn">新增</button>
                                        </a>

                                    </div>
                                </form>
                            </div><!-- /.box-body -->
                        </div><!-- /.box -->
                        <form method="post" target="_self" action="" name="listForm">
                            <div class="box-body table-responsive" id="listDiv">
                                <s:property value="res" escape="false"/>
                            </div><!-- /.box-body -->
                        </form>

                    </div><!-- /.box -->
                </div>
            </div>
        </section>
        <!-- /.content -->
    </aside>
</div>
</body>

<script type="text/javascript">

    function searchAdvertisement() {
        var name=Utils.trim($("#condition1").val());
        var postion=$("#position").val();
        var state=$("#state").val();

        listTable.filter['advertisementName'] =name;
        listTable.filter['positionid'] =postion;
        listTable.filter['isUsedFlag'] =state;
        listTable.filter['currentPage']=1;
        listTable.action = "<%=basePath%>/common/ajaxQueryAdvertisementList.action";
        listTable.loadList();

    }

    $(document).ready(new function () {
        searchAdvertisement();
    })

</script>

</html>
